﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace comix
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Command(object sender, CommandEventArgs e)
        {
            LCustomer c = (LCustomer)Session["customer"];
            c.username = tb_mail.Text;
            c.password = tb_password.Text;
            if (c.LogIn())
            {
                c.FillItem();
                FormsAuthentication.SetAuthCookie(c.Id.ToString(), false);
                Response.Redirect("home.aspx");
            }
        }
    }
}
